package com.soft.service;

import com.soft.dao.UserDAO;
import com.soft.pojo.User;

public class UserService {
    public UserDAO userdao = new UserDAO();

    public User login(User user) {
        User user2 = userdao.selectUserByUsernameAndPassword(user);
        return user2;
    }

    public boolean register(User user) {
        boolean c = false;
        boolean b = userdao.selectUserByUsername(user);
        if (!b) {
            c = true;
            userdao.insertUser(user);
        }
        return c;
    }
}
